
<%--
  Created by IntelliJ IDEA.
  User: 刘洋
  Date: 2019/12/19
  Time: 10:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://fentsoul.com" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html>
<head>
	<title>商品列表</title>
	<meta charset="utf-8"/>
	<link rel="stylesheet" href="/css/bootstrap.css"/>
</head>
<body>
<div class="container-fluid">


	<nav class="navbar navbar-default" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<a class="navbar-brand" href="">蛋糕店后台</a>
			</div>
			<div>
				<ul class="nav navbar-nav">
					<li><a href="orderList.action">订单管理</a></li>
					<li><a href="userList.action">客户管理</a></li>
					<li class="active"><a href="goodList.action">商品管理</a></li>
					<li><a href="typeList.action">类目管理</a></li>
					<li><a href="adminRe.action">修改密码</a></li>
					<li><a href="logout.action">退出</a></li>
				</ul>
			</div>
		</div>
	</nav>

	<div class="text-right"><a class="btn btn-warning" href="/goods/add">添加商品</a></div>

	<br>

	<ul role="tablist" class="nav nav-tabs">
		<li class="active" role="presentation"><a>全部商品</a></li>
		<li role="presentation"><a>条幅推荐</a></li>
		<li role="presentation"><a>热销推荐</a></li>
		<li role="presentation"><a>新品推荐</a></li>
	</ul>


	<br>

	<table class="table table-bordered table-hover">

		<tr>
			<th width="5%">ID</th>
			<th width="10%">图片</th>
			<th width="10%">名称</th>
			<th width="20%">介绍</th>
			<th width="10%">价格</th>
			<th width="10%">类目</th>
			<th width="25%">操作</th>
		</tr>

		<f:foreach jsp_for="goods" var="g">
			<tr>
				<td><p>${g.id}</p></td>
				<td><p>
					<a href="/goods/detail/${g.id}" target="_blank"><img src="${g.cover}" width="100px" height="100px"></a>
				</p></td>
				<td><p><a href="/goods/detail/${g.id}" target="_blank">${g.name}</a></p></td>
				<td><p>${g.intro}</p></td>
				<td><p>39</p></td>
				<td><p></p></td>
				<td>
					<p>

						<a class="btn btn-primary" href="topSave.action?tops.type=1&tops.good.id=180" disabled>加入条幅</a>

						<a class="btn btn-primary" href="topSave.action?tops.type=2&tops.good.id=180" disabled>加入热销</a>

						<a class="btn btn-primary" href="topSave.action?tops.type=3&tops.good.id=180" disabled>加入新品</a>
					</p>
					<a class="btn btn-success" href="/goods/edit/${g.id}">修改</a>
					<a class="btn btn-danger" href="goodDelete.action?good.id=180" disabled>删除</a>
				</td>
			</tr>
		</f:foreach>


	</table>

	<br>
	<div style='text-align:center;'>

		<div>
			<div style='text-align:center;'>
				<%--<a class='btn btn-info' disabled >首页</a>--%>
				<a class='btn btn-info' href="/goods/goodsManage?page=0&size=${Model.size}">首页</a>
				<%--<f:a method="classify" route="${Model.type}&0&${Model.size}">首页</f:a>--%>

				<a class='btn btn-info'
				   href="/goods/goodsManage?&page=${Model.page-1}&size=${Model.size}"
				   <c:if test="${Model.page == 0}">disabled</c:if>
				>上一页</a>
				<h2 style='display:inline;'>[${Model.page+1}/${Model.total+1}]</h2>
				<h2 style='display:inline;'>[${Model.count}]</h2>
				<a class='btn btn-info'
				   href="/goods/goodsManage?&page=${Model.page+1}&size=${Model.size}"
				   <c:if test="${Model.page == Model.total}">disabled</c:if>
				>下一页</a>
				<%--<a class='btn btn-info' disabled >下一页</a>--%>
				<a class='btn btn-info'
				   href="/goods/goodsManage?&page=${Model.total}&size=${Model.size}">尾页</a>

				<%--<a class='btn btn-info' disabled >尾页</a>--%>
				<input type='text' class='form-control' style='display:inline;width:60px;' value=''/><a
					class='btn btn-info' href='javascript:void(0);'
					onclick='location.href="http://localhost:8080/test_cakeshop_jsp/index/goods.action?page="+(this.previousSibling.value)+"&typeid=5"'>GO</a>
			</div>
		</div>
	<br>
</div>
</body>
</html>